/**
 * 对象转数组
 * 将
 * let obj = {
 *      "张三":{age:15,sex:男},
 *      "李四":{age:20,sex:女}
 * }
 *
 * 经过function(obj,"name")转变为
 *
 * [
 *     {name:"张三",age:15,sex:男},
 *     {name:"李四",age:20,sex:女},
 * ]
 * @param obj
 * @param keyName
 */
export default function (obj: any, keyName: any) {
    let arr: any = []
    let key: string
    for (key in obj) {
        obj[key][keyName] = key
        arr.push(obj[key])
    }
    return arr
}

